<?php
/**
 * Created by PhpStorm.
 * User: addd
 * Date: 2020/10/22
 * Time: 16:56
 */
namespace App\Admin\Selectable;

use App\Models\User;
use Encore\Admin\Facades\Admin;
use Encore\Admin\Grid\Filter;
use Encore\Admin\Grid\Selectable;

class Users extends Selectable
{
    public $model = User::class;
    protected $perPage = 10;

    public function make()
    {
        // TODO: Implement make() method.
        $this->column('nick_name','用户名称');
        $this->column('mobile', '手机');

        $this->filter(function (Filter $filter) {
            // 去掉默认的id过滤器
            $filter->disableIdFilter();
            $filter->like('nick_name','用户名');
            $filter->equal('mobile', '手机');
        });
    }
}